package com.endava.FlowControlAndAssertions;

/*3. Sa se creeze o metoda care ordoneaza trei numere.*/

public class Ex3 {

	public double[] sortNumbers(double a, double b, double c) {
		double[] result = new double[3];
		double aux;
		if (b < a) {
			aux = b;
			b = a;
			a = aux;
		}
		if (c < b) {
			aux = c;
			c = b;
			b = aux;
		}
		if (b < a) {
			aux = b;
			b = a;
			a = aux;
		}

		result[0] = a;
		result[1] = b;
		result[2] = c;
		return result;
	}

	public static void main(String[] args) {
		Ex3 e = new Ex3();
		double[] res = e.sortNumbers(6.7, 2.3, 8.9);
		System.out.println("a=" + res[0] + " b=" + res[1] + " c=" + res[2]);

	}

}
